package com.xian.im.web.modules.sys;

import com.xian.im.common.model.from.DictFrom;
import com.xian.im.common.result.RestResult;
import com.xian.im.common.result.RestResultBuilder;
import com.xian.im.common.utils.sys.PageUtils;
import com.xian.im.modules.im.dao.DictDao;
import com.xian.im.modules.im.service.DictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author xlr
 * @email 
 * @date 2021-01-18 19:11:56
 */
@RestController
@RequestMapping("im/dict")
@Api(tags = {"数据字典"})
public class DictController {

    @Autowired
    private DictService dictService;

    @ApiOperation(value = "数据字典查询", notes = "数据字典查询")
    @RequestMapping(value = "/page",method = RequestMethod.POST)
    public RestResult<PageUtils<DictDao>> type(@RequestBody DictFrom from){
        PageUtils<DictDao> page = dictService.findPage(from);
        return RestResultBuilder.builder().success( ).data(page).build();
    }
}
